import { service } from '@/utils/request'
import { CaptchaChallenge, Captcha } from './captcha.dto'

export function getCaptcha () {
  return service.get<Captcha>('/captcha')
}

export function challenge (params: CaptchaChallenge, quiet = true) {
  const { key, value } = params
  return service.get<boolean>('/captcha/challenge', {
    params: { key, value, _quiet: quiet }
  })
}
